<template>
  <div class="my">
      <ol>
        <li>{{$t("index.period")}}</li>
        <li>{{$t("index.amount")}}</li>
        <li>{{$t("index.profit")}}</li>
      </ol>
      <ul>
        <li v-for="(item,index) in records" :key="index">
          <div>
            <i :class="item.profit.toString()[0]==='-'?'red':'green'"></i>
            <span>{{item.period}}</span>
          </div>
          <div>{{item.amount}}</div>
          <div :class="item.profit.toString()[0]==='-'?'red':'green'">{{item.profit}}</div>
        </li>
      </ul>
  </div>
</template>

<script>
export default {
  data(){
    return{
      records:[
        {period:'0316322',amount:'2.3456',profit:'2.2436'},
        {period:'0316321',amount:'2.3456',profit:'-2.2436'},
        {period:'0316320',amount:'2.3456',profit:'-2.2436'},
        {period:'0316319',amount:'2.3456',profit:'2.2436'},
        {period:'0316318',amount:'2.3456',profit:'-2.2436'},
      ]
    }
  },
}
</script>

<style lang="scss" scoped>
.my{
  >ol{
    display: flex;
    font-size: .12rem;
    justify-content: space-between;
    padding: 0 .23rem;
    margin-top: .15rem;
    line-height: 2.2;
    li{
      width: calc((100% - .3rem) / 3);
      text-align: right;
    }
    >li:nth-of-type(1){
      text-align: left;
      padding-left: .2rem;
      box-sizing: border-box;
    }
  }
  >ul{
    margin-bottom: .15rem;
    li{
      padding: 0 .23rem;
      display: flex;
      font-size: .1rem;
      justify-content: space-between;
      border-top: solid 0.0033rem #445F74;
      height: .33rem;
      line-height: .33rem;
      >div{
        width: calc((100% - .2rem) / 3);
        display: flex;
        align-items: center;
        justify-content: flex-end;
        >i{
          height: .133rem;
          width: .133rem;
          border-radius: 50%;
          background: #000000;
          margin-right: .08rem;
        }
        >i.red{
          background: #FE624E;
        }
        >i.green{
          background: #38E6B7;
        }
      }
      >div.red{
        color: #FE624E;
      }
      >div.green{
        color: #38E6B7;
      }
      >div:nth-of-type(1){
        justify-content: flex-start;
      }
    }
  }
}
</style>